package com.hxzy.member.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
//import com.github.pagehelper.PageInfo;
import com.hxzy.member.dao.MemberDao;
import com.hxzy.member.pojo.Member;
import com.hxzy.member.pojo.MemberVo;
import com.hxzy.member.service.MemberService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/member")
public class MemberController {
    @Autowired
    private MemberService memberService;


    @RequestMapping("/getMember/{currPage}/{pageSize}")
    public Page<Member> getMember(@PathVariable Integer currPage , @PathVariable Integer pageSize){
        Page<Member> memberPage = memberService.selectByPage(currPage, pageSize);
        return memberPage;
    }

    @RequestMapping("/searchMember")
    public Map<String, Object> searcheMember(MemberVo memberVo){
        Map<String, Object> map = memberService.selectByCondition(memberVo);
        return map;
    }





}
